<template>
  <div>
    <div class="accountInfo">
        <div class="alertInfo">
          <h2><a href="javascript:void(0);">**显示信息**</a></h2>
          <a href="javascript:void(0);">**显示信息**</a>
        </div>
        <div class="right">
          <p><a style="font-weight: bold;color: #083C66;" href="um/inform.do?theAction=list" target="navTab" rel="通知查看" title="通知查看" fresh="true">查看所有通知</a></p>
          <p><a target="dialog" title="查看应用系统信息" href="batch/manage/syslog.do?theAction=view&sysid=BCP" style="line-height:19px;font-weight: bold;" height="410" width="830">查看应用系统信息</a></p>
        </div>
        <p>
          <span style="font-weight:bold;font-size: 18px;">
            您今天有&nbsp;<a href="um/inform.do?theAction=list&type=today" target="ajax" rel="jbsxBox" style="color:red;font-size: 20px;">0</a>&nbsp;条通知信息。
            其中&nbsp;<a href="um/inform.do?theAction=list&type=today&checkflag=0" target="ajax" rel="jbsxBox" style="color:red;font-size: 20px;">0</a>&nbsp;条未查看。
            共有&nbsp;<a href="um/inform.do?theAction=list&checkflag=0" target="ajax" rel="jbsxBox" style="color:red;font-size: 20px;">0</a>&nbsp;条未查看。
          </span>
        </p>
        <p>上次登录时间：${userinfo.lastlogin }</p>
      </div>
    <!-- 面包屑导航 -->
    <el-breadcrumb separator-class="el-icon-arrow-right">
      <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
    </el-breadcrumb>
    <!-- 搜索筛选 -->
    <el-form :inline="true" :model="formInline" class="user-search">
      <el-form-item label="通知名称：">
        <el-input size="small" v-model="formInline.deptName" placeholder="输入通知名称"></el-input>
      </el-form-item>
      <el-form-item label="日期">
        <el-date-picker align="right" type="date" placeholder="输入日期" ></el-date-picker>
      </el-form-item>
      <el-select v-model="value" clearable placeholder="请选择">
        <el-option
          v-for="item in options"
          :key="item.value"
          :label="item.label"
          :value="item.value">
        </el-option>
      </el-select>

      <el-form-item>
        <el-button size="small" type="primary" icon="el-icon-search" @click="search">搜索</el-button>
      </el-form-item>
    </el-form>
    <!-- 分页组件 -->
    <Pagination v-bind:child-msg="pageparm" @callFather="callFather"></Pagination>
  </div>
</template>

<script>
import { deptList, deptSave, deptDelete } from '../../api/userMG'
import Pagination from '../../components/Pagination'
export default {
  data () {
    return {
      nshow: true, //switch开启
      fshow: false, //switch关闭
      loading: false, //是显示加载
      editFormVisible: false, //控制编辑页面显示与隐藏
      title: '添加',
      editForm: {
        deptId: '',
        deptName: '',
        deptNo: '',
        token: localStorage.getItem('logintoken')
      },

      formInline: {
        page: 1,
        limit: 10,
        varLable: '',
        varName: '',
        token: localStorage.getItem('logintoken')
      },

      userparm: [], //搜索权限
      listData: [], //用户数据
      // 分页参数
      pageparm: {
        currentPage: 1,
        pageSize: 10,
        total: 10
      },
      options: [{
        value: '选项1',
        label: '未查看'
      }, {
        value: '选项2',
        label: '已查看'
      }],
      value: ''
    }
  },
  // 注册组件
  components: {
    Pagination
  },
  /**
   * 数据发生改变
   */

  /**
   * 创建完毕
   */
  created() {
    this.getdata(this.formInline)
  },

  /**
   * 里面的方法只有被调用才会执行
   */
  methods: {
    // 获取公司列表
    getdata(parameter) {
      this.loading = true
      /***
       * 调用接口，注释上面模拟数据 取消下面注释
       */
      // deptList(parameter)
      //   .then(res => {
      //     this.loading = false
      //     if (res.success == false) {
      //       this.$message({
      //         type: 'info',
      //         message: res.msg
      //       })
      //     } else {
      //       this.listData = res.data
      //       // 分页赋值
      //       this.pageparm.currentPage = this.formInline.page
      //       this.pageparm.pageSize = this.formInline.limit
      //       this.pageparm.total = res.count
      //     }
      //   })
      //   .catch(err => {
      //     this.loading = false
      //     this.$message.error('菜单加载失败，请稍后再试！')
      //   })
    },
    // 分页插件事件
    callFather(parm) {
      this.formInline.page = parm.currentPage
      this.formInline.limit = parm.pageSize
      this.getdata(this.formInline)
    },
    // 搜索事件
    search() {
      this.getdata(this.formInline)
    },
  }
}
</script>

<style scoped>
.user-search {
  margin-top: 20px;
}
.userRole {
  width: 100%;
}

.accountInfo {
  display:block;
  overflow:hidden;
  height:60px;
  padding:0 10px;
  background:url(../../assets/img/account_info_bg.png) repeat-x;
}

.accountInfo p {
  padding:8px 0 0 0;
  line-height:19px;
}
.accountInfo p span {
  font-size:14px;
  font-weight:bold;
}
.accountInfo .right {
  float:right;
  padding-right:10px;
  ext-align:right;
}
.accountInfo .alertInfo {
  float:right;
  width:300px;
  height:60px;
  padding-left:10px;
  border-left:solid 1px #accdf4;
}
.accountInfo .alertInfo h2 {
  padding:8px 0;
  line-height:17px;
}
.accountInfo .alertInfo a {
  padding:6px 0 0 0;
  line-height:21px;
}
</style>
